import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import axios from 'axios'

// 配置请求的基准URL地址
axios.defaults.baseURL = 'http://localhost:55799/api/'
// 配置请求头信息
//axios设置请求拦截器
axios.interceptors.request.use(
  config => {
  if(localStorage.getItem("Token")!=null){
    config.headers.Authorization="Bearer " + localStorage.getItem("Token")
  }
  return config
}, err => {
  console.log(err)
})

import { Tab, Tabs } from 'vant';



// axios.defaults.headers.common['Authorization'] = "Bearer " + localStorage.getItem("Token")

const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})

app.use(Tab);
app.use(Tabs);

app.use(createPinia())
app.use(router)

app.mount('#app')
